package com.lanmon.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity  
@Table(name="com_student")  
public class ComStudent implements Serializable{
	private Integer stuid;
	private ComUser comUser;
	private Date inDate;
	private Integer proid;
	
	@GenericGenerator(name = "generator", strategy = "identity")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "stuid", unique = true, nullable = false)
	public Integer getStuid() {
		return stuid;
	}
	public void setStuid(Integer stuid) {
		this.stuid = stuid;
	}
	@OneToOne(fetch=FetchType.LAZY)  
	@JoinColumn(name="userid")  
	public ComUser getComUser() {
		return comUser;
	}
	public void setComUser(ComUser comUser) {
		this.comUser = comUser;
	}
	@Column(name = "in_date", nullable = false, length = 50)
	public Date getInDate() {
		return inDate;
	}
	public void setInDate(Date inDate) {
		this.inDate = inDate;
	}
	
	@Column(name = "proid", nullable = false, length = 50)
	public Integer getProid() {
		return proid;
	}
	public void setProid(Integer proid) {
		this.proid = proid;
	}
	
}
